package idpa.paul.hangman.controller;


import java.util.Random;

import idpa.paul.hangman.model.hangmanModel;
import idpa.paul.hangman.view.MainActivity;
import idpa.paul.hangman.view.R;

public class NewGameController {

	
	MainActivity g;
	hangmanModel m;
	
	
	
	public NewGameController(hangmanModel m, MainActivity g){
		
		this.g=g;
		this.m=m;
		
		
		
	}
	public void process(){
		
		//set image back to first 
		g.hangmanImage.setImageResource(R.drawable.board5);
		g.display_guessedLetters.setText("");
		//reset letter array
		for(int i=0; i< g.letters.length; i++){
			
			g.letters[i].setText("_  ");
			
		}
		Random genWord = new Random();
		String[] wordList = g.getResources().getStringArray(R.array.dictionary);
		int numWord = genWord.nextInt(wordList.length);
		m.initialize(wordList[numWord]);
		
	}
	
	
	
}
